﻿using System;

using RayDen.Library.Entity.Renderer;

namespace Frames
{
    public class FrameSequenceInfo
    {
        public string MovieName;
        public int FramesPerSecond;
        public TimeSpan Duration;
        public QualitySettingsInfo FrameQualitySettings;
        public OutputSettingsInfo FrameOutputSettings;

        public int TotalFrames
        {
            get { return (int)Math.Round(Duration.TotalSeconds / FramesPerSecond); }
        }

        public int ImageSamplesPerFrame
        {
            get
            {
                return FrameOutputSettings.Width * FrameOutputSettings.Height * FrameQualitySettings.SamplesPerPixel *
                       FrameQualitySettings.SuperSamplingSize;
            }
        }

        public int ImageSamplesPerThread(int threadCount)
        {
            return FrameOutputSettings.Width * (FrameOutputSettings.Height / threadCount) * FrameQualitySettings.SamplesPerPixel *
                   FrameQualitySettings.SuperSamplingSize;
        }
        
        public string GetFilename(int index)
        {
            return string.Format("frame_{0}_{1}", MovieName, index);
        }
    }
}
